package com.breezelin.freshmarket.network.asynctasks;

import com.breezelin.freshmarket.entities.data.UserInfo;
import com.breezelin.freshmarket.entities.network.ReqNRsp;
import com.breezelin.freshmarket.network.FMAsyncTask;
import com.breezelin.freshmarket.network.apis.ProfileApi;

/**
 * Created by Breeze Lin
 * 2016/9/24 9:08
 * 1linyufeng1@gmail.com
 */

public abstract class RegisterTask extends FMAsyncTask<Void, Void, ReqNRsp<UserInfo>> {

	/**
	 * 电话号码
	 */
	private String phoneNo;
	/**
	 * 验证码
	 */
	private String verifyCode;
	/**
	 * 密码
	 */
	private String password;

	/**
	 * 注册异步任务
	 *
	 * @param phoneNo    电话号码
	 * @param verifyCode 验证码
	 * @param password   密码
	 */
	public RegisterTask(String phoneNo, String verifyCode, String password) {
		super(ProfileApi.REGISTER);
		this.phoneNo = phoneNo;
		this.verifyCode = verifyCode;
		this.password = password;
	}

	@Override
	protected ReqNRsp<UserInfo> doInBackground(Void... params) {
		return ProfileApi.register(phoneNo, verifyCode, password);
	}
}
